﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

namespace nkl
{

    public class Slot : MonoBehaviour { 

        public Text itemCountText;

        public Image itemImage;

        public int index;

        public ItemType type;

        private void Awake()
        {
            setIndex();
        }

        void setIndex()
        {
            string[] mname = transform.name.Split('(');
            string fname = mname.GetValue(mname.Length - 1).ToString();
            string indexStr = fname.Split(')').GetValue(0).ToString();
            int finalIndex = int.Parse(indexStr);
            this.index = finalIndex;
        }
    }
}